// import 'lib-flexible'
import i18n from 'src/i18n'

import ElementUI from 'element-ui'
import 'src/common_css/theme.scss'
Vue.use(ElementUI)

import Vue from 'vue'
import App from 'components/layout/UserLayout.vue'
import VueRouter from 'vue-router'
import routes from './routers'

import { routerBeforeEach, routerAfterEach } from 'api/permission' // 验权

import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
    preLoad: 6,
    // loading: 'https://topcoin.oss-cn-hangzhou.aliyuncs.com/front/gray.jpg',
    error: 'https://topcoin.oss-cn-hangzhou.aliyuncs.com/front/gray.jpg',
    attempt: 6
})


Vue.use(VueRouter);
const router = new VueRouter({
	scrollBehavior: () => ({
        y: 0
    }),
    routes
});

router.beforeEach(routerBeforeEach)

router.afterEach(routerAfterEach)


new Vue({
	i18n,
    el: '#app',
    render: h => h(App),
    router,
});

